Conversation
The mirrors-mypy hook runs in an isolated environment whose
additional_dependencies only listed python-box, so httpx was not
installed there. With mypy strict + ignore_missing_imports, httpx.Auth
collapsed to Any and disallow_subclassing_any failed locally on
mpt_api_client/auth/base.py ("Class cannot subclass Auth"). CI runs
mypy with full deps (make check-all) and stayed green, so this only
affected developers running pre-commit locally.
Add httpx==0.28.* and httpx-retries==0.5.* to the hook's
additional_dependencies, mirroring the pins in pyproject.toml
[project].dependencies, so the hook env matches the project and
`pre-commit run mypy` passes.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
📜 Recent review details⏰ Context from checks skipped due to timeout. (1)
🧰 Additional context used🧠 Learnings (1)📚 Learning: 2026-04-16T11:49:53.579ZApplied to files:
🔇 Additional comments (1)
📝 WalkthroughWalkthroughTwo entries, Changesmypy pre-commit dependency update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|



🤖 AI-generated PR — Please review carefully.
What
Add the project runtime dependencies (
httpx==0.28.*,httpx-retries==0.5.*) to themirrors-mypyhook'sadditional_dependenciesin.pre-commit-config.yaml, mirroring the pins inpyproject.toml[project].dependencies.Why
The mypy pre-commit hook runs in an isolated environment that previously installed only
python-box. Withhttpxmissing there, mypystrict = true+ignore_missing_imports = truemadehttpx.Authcollapse toAny, anddisallow_subclassing_anyfailed locally on unchanged code:CI runs mypy with the full project dependencies (
make check-all/uv run mypy .) and stayed green, so this only bit developers runningpre-commit runlocally. Aligning the hook's environment with the project's runtime deps removes the discrepancy.Testing
uv run pre-commit run mypy --all-files→ passespre-commit run --all-files, plusruff format --check,ruff check,flake8,mypy,uv lock --check→ greenpytest tests/unit→ 2310 passed, 99% coverageCloses MPT-22538
httpx==0.28.*andhttpx-retries==0.5.*to themirrors-mypyhook'sadditional_dependenciesin.pre-commit-config.yamlto align the mypy pre-commit environment with project runtime dependenciespre-commit rundue to missing type information forhttpx.Authin the isolated pre-commit environment